<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='护理级别-编辑',jsPaths='/static/js/services/meal/add.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                     <a href="/organization">系统管理</a>
                    <a href="/meal">护理级别</a>
                    <a><cite>编辑</cite></a>
                </span>
    </div>

    <!--主体内容区-->
    <div class="form-content layui-container">
        <form class="layui-form" th:action="@{/meal/update}" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label must">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" th:value="${meal.name}"  maxlength="30" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
                    <input type="hidden" name="id" th:value="${meal.id}">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">简介</label>
                <div class="layui-input-block">
                    <textarea name="intro" placeholder="护理级别简介" maxlength="1000" class="layui-textarea" th:text="${meal.intro}"></textarea>
                </div>
            </div>
            <blockquote class="layui-elem-quote layui-quote-nm" style="color:orangered;font-size: 18px;">请选择该护理级别包含的服务项目</blockquote>
            <div class="healthDataItems">
                <table  class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 20%;">服务项目</th>
                        <th style="width: 10%;"  th:if="${price == 1}">单价</th>
                        <th style="width: 10%;">操作</th>
                    </tr>
                    </thead>
                    <tr th:each="item : ${items}">
                        <td th:text="${item.name}"></td>
                        <td  th:text="${item.price}"  th:if="${price == 1}"> </td>
                        <td>
                            <input type="checkbox" name="itemsId" th:value="${item.id}" th:checked="${#lists.contains(mealItemsIds,item.id)}" title="选择" lay-filter="xz">
                            <input type="hidden" name="itemsName" th:disabled="${!#lists.contains(mealItemsIds,item.id)}" th:value="${item.name}">
                        </td>
                    </tr>
                </table>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                    <a href="/meal" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>

    </div>
</div>
</html>